package com.training.io.serial;

import java.io.FileNotFoundException;
import java.io.FileOutputStream;
import java.io.IOException;
import java.io.ObjectOutputStream;

public class SerialDemo {

	public static void main(String[] args) throws Exception {
		ObjectOutputStream out = new ObjectOutputStream(
				new FileOutputStream("D:\\car.bat"));
		
		Car c = new Car();
		
		c.setBrand("BMW");
		c.setColor("blue");
		c.setPrice(1000000);
		
		out.writeObject(c);
		out.close();

	}

}
